package com.hashcoding.eyes;

import android.app.Application;

import com.hashcoding.eyes.module.utils.CrashHandler;
import com.hashcoding.eyes.module.utils.FileUtil;
import com.hashcoding.eyes.module.utils.LogUtil;

/**
 * EyesApplication
 *
 * @author Maochuan
 * @date 2016-02-03
 */
public class EyesApplication extends Application {
    public static EyesApplication gContext;

    @Override
    public void onCreate() {
        super.onCreate();
        gContext = this;
        init();
    }

    private void init() {
        // 读取登录信息
        // LoginManager.getInstance(gContext).init();

        // 隐藏sd目录
        FileUtil.hideMediaFile();

        // 设置日志开关
        LogUtil.setLogEnable(BuildConfig.DEBUG);

        // 记录崩溃异常
        CrashHandler crashHandler = new CrashHandler(gContext);
        Thread.setDefaultUncaughtExceptionHandler(crashHandler);
    }
}
